// ErrorUtilsTestMainApp.tsx
import React from 'react';
import {View, Text, Button} from 'react-native';

export default function ErrorUtilsTestMainApp() {
  const triggerAsyncError = () => {
    setTimeout(() => {
      throw new Error('异步错误：来自 setTimeout 的异常！');
    }, 1000);
  };

  return (
    <View style={{padding: 20}}>
      <Text style={{marginBottom: 10}}>
        点击按钮模拟异步错误（ErrorUtils 能捕获）
      </Text>
      <Button title="触发异步错误" onPress={triggerAsyncError} />
    </View>
  );
}
